import request from '@/utils/request';

export const getList = (params) => {
  return request({
    url: '/insurance/insuranceRecommend/getList',
    method: 'get',
    params: params,
  });
};

export const getListDs = (params) => {
  return request({
    url: '/insurance/insuranceRecommendDs/getListDs',
    method: 'get',
    params: params,
  });
};

export const selectInsuranceProduct = (params) => {
  return request({
    url: '/insurance/insuranceRecommendDs/selectInsuranceProduct',
    method: 'get',
    params: params,
  });
};

export const addPersonaInsurance = (data) => {
  return request({
    url: '/insurance/insuranceRecommend/addPersonaInsurance',
    method: 'post',
    data,
  });
};

export const getPersonaInsuranceList = (params) => {
  return request({
    url: '/insurance/insuranceRecommend/getPersonaInsuranceList',
    method: 'get',
    params: params,
  });
};

export const deletePersonaInsuranceById = (data) => {
  return request({
    url: '/insurance/insuranceRecommend/deletePersonaInsuranceById',
    method: 'delete',
    data,
  });
};

export const getCountPersonaInsuranceByInsuranceType = (params) => {
  return request({
    url: '/insurance/insuranceRecommend/getCountPersonaInsuranceByInsuranceType',
    method: 'get',
    params: params,
  });
};

export const getComparisonInfo = (params) => {
  return request({
    url: '/insurance/comparison/getInfo/1',
    method: 'get',
    params: params,
  });
};

const config = {
  baseURL: 'http://10.18.124.22:6557',
};

export const insuranceAnalysisCompare = (data) => {
  return request({
    url: '/api/insurance-analysis-compare',
    method: 'post',
    data: data,
    ...config,
  });
};
